package heima3_2.cn.osc.ui.activity_fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import net.oschina.app.R;

import butterknife.Bind;
import butterknife.ButterKnife;
import heima3_2.cn.osc.presenter.ExerciseRecentlyPresenter;
import heima3_2.cn.osc.ui.adapter.ExerciseRecentlyAdapater;

/**
 * Created by emily on 2017/1/14.
 */
public class RecentlyActivityFragment extends Fragment {


    public ExerciseRecentlyAdapater exerciseRecentlyAdapater;
    @Bind(R.id.lv_recently_exercise)
    ListView lvRecentlyExercise;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View viewItem = inflater.inflate(R.layout.find_fragment_exercise__recently_activity, container, false);
        ButterKnife.bind(this, viewItem);
        ExerciseRecentlyPresenter exerciseRecentlyPresenter = new ExerciseRecentlyPresenter(this);
        exerciseRecentlyPresenter.getData(0);
        //设置适配器
        exerciseRecentlyAdapater = new ExerciseRecentlyAdapater(getActivity(), null);
        lvRecentlyExercise.setAdapter(exerciseRecentlyAdapater);
        return viewItem;
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
